Hey All, |
Re: DXL "formal" programming structure Advice: Figure out what your globals are going to be and compartmentalize each routine...make sure each routine does a specific thing. I personally like using function names that make sense with the action....something like: int getNumberOfShallsInModule(Module mGiven) { Another thing--try to name variables after what they represent...as in string strMyModule = "/Path/To/My/Module" etc. Again, sorry for not using official syntax for code examples. When this forum supports Chrome and Safari, my posts will look much better. ;) Have fun! |
Re: DXL "formal" programming structure
You understand that functions execute top down, but they reference functions that are defined above. The first functions to execute are at the bottom of the script. Often, the final statement in the file is the first one that actually executes, not counting global declarations and initializations.
{ int i = 0
void Slave()
{ i++
}
Slave()
}
Folks with sharper memories and can juggle 20 balls don't need such rigor, but then they end up writing code nobody else can figure out; often including themselves later on down the road.
|
Re: DXL "formal" programming structure llandale - Sun Jul 31 23:48:16 EDT 2011
You understand that functions execute top down, but they reference functions that are defined above. The first functions to execute are at the bottom of the script. Often, the final statement in the file is the first one that actually executes, not counting global declarations and initializations.
{ int i = 0
void Slave()
{ i++
}
Slave()
}
Folks with sharper memories and can juggle 20 balls don't need such rigor, but then they end up writing code nobody else can figure out; often including themselves later on down the road.
Thanks for the response! I kind of figured it was top down liek you mentioned, juse I have seen from some programs. It has been a while since I used that method, but I can do it. My predecessors seemed to have a hard time with that. They also like to do multiple nesting, or one fucntion/procedure calling another, and then that walling calling, etc. I try to avoid that as much as possible. I liek your very last statement! How true it is. Thank goodness I only encounter that in certain areas, and not the whole program! Thanks! Jerry |